package com.mocha.bss.config;

import com.coffee.core.CoffeeResponseEnum;
import com.coffee.core.ResponseCode;

/**
 * smart 收运中台 错误码 以100000
 * 按照业务分；
 *   比如  101000开头 表示商户相关错误码
 *   比如  102000开头 表示桶相关错误码
 * @author songkui
 * @since 2024/4/28 13:58
 */
public enum BssResponseEnum implements ResponseCode {

    /** 公告 */
    VersionSame(10100, "版本号一致"),

    /** 用户相关 */
    UserExist(201001, "电话号码或账号已存在"),
    /** 角色相关 */
    RoleExist(301001, "角色名称或编码已存在");

    private final int code;
    private final int opcode;
    private final String message;


    private BssResponseEnum(CoffeeResponseEnum coffeeEnum){
        this.code = coffeeEnum.code();
        this.opcode = coffeeEnum.opcode();
        this.message = coffeeEnum.message();
    }

    private BssResponseEnum(int code, int opcode, String msg) {
        this.code = code;
        this.opcode = opcode;
        this.message = msg;
    }

    private BssResponseEnum(int code, String message){
        this.code = code;
        this.message = message;
        this.opcode = 0;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public int opcode() {
        return this.opcode;
    }

    @Override
    public String message() {
        return this.message;
    }


}
